<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model指令</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        姓名: <input type="text" placeholder="请输入姓名" v-model="userForm.name"> <br>
        年龄: <input type="text" placeholder="请输入年龄" v-model="userForm.age"> <br>
        <div>
            姓名:{{userForm.name}}<br>
            年龄:{{userForm.age}}<br>
        </div>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
           userForm:{
               name:'',
               age:0
           }
        }
    });
</script>